<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>layout布局页面</title>
		<!-- 导入 jquery 核心类库 -->
			<script type="text/javascript" src="../js/jquery-1.8.3.js"></script>
			<!-- 导入 easyui 类库 -->
			<script type="text/javascript" src="../js/easyui/jquery.easyui.min.js"></script>
			<!– 导入默认主题 CSS 文件-->
			<link id="easyuiTheme" rel="stylesheet" type="text/css" href="../js/easyui/themes/default/easyui.css">
			<!– 导入图标 CSS 文件-->
			<link rel="stylesheet" type="text/css" href="../js/easyui/themes/icon.css">
			<!– 导入国际化信息文件-->
			<script src="../js/easyui/locale/easyui-lang-zh_CN.js" type="text/javascript"></script>
			<script src="../js/ztree/jquery.ztree.all-3.5.js"  charset="utf-8" type="text/javascript"></script>
			<link rel="stylesheet" type="text/css" href="../js/ztree/zTreeStyle.css"/>
			<script type="text/javascript">
			
			$(function(){
				var setting = {
					data: {
						simpleData: {
							enable:true
						}
					},
				callback: {
					
						onClick : function(event, treeId, treeNode, clickFlag){
							var content = '<div style="width:100%;height:100%;overflow:hidden;">'
								+ '<iframe src="'
								+ treeNode.page
								+ '" scrolling="auto" style="width:100%;height:100%;border:0;" ></iframe></div>';
							
							// 没有page树形菜单，不打开选项卡
							if(treeNode.page != undefined && treeNode.page != ""){
								// 如果选项卡已经打开，选中 
								if($("#mytabs").tabs('exists',treeNode.name)){
									// 选中选项卡
									$("#mytabs").tabs('select',treeNode.name);
								}else{
									// 如果没有打开，添加选项卡 
									$("#mytabs").tabs('add',{
										title:treeNode.name,
										content: content,
										closable :true
									});
								}
							}
						}
					}
				};
				var zNodes =[
					{id:1,pId:0,name:"父节点"},
					{id:2,pId:0,name:"父节点"},
					{id:11,pId:1,name:"子节点"},
					{id:12,pId:1,name:"子节点"},
					{id:13,pId:2,name:"传智播客",page:"http://www.itcast.cn"},
					{id:14,pId:2,name:"百度",page:"https://www.baidu.com"}
				];
				
				$.fn.zTree.init($("#baseMenu"), setting, zNodes);
				
				$("#mytabs").tabs({
					onContextMenu:function(e, title,index){
						debugger;
						//阻止浏览器默认右键菜单
						e.preventDefault();
						$('#mm').menu('show',{
							
							left:e.pageX,
							top:e.pageY
						});
					}
				});
			});
			</script>
	</head>
	<body class="easyui-layout"> 

		<div data-options="region:'north',title:'North Title',split:true" style="height:100px;">
			<a href="javascript:void(0)" id="mb" class="easyui-menubutton" data-options="iconCls:'icon-save',menu:'#md'">菜单</a>
				<div id="md" style="width:120px;">
					<div>菜单一</div>
					<div>菜单二</div>
					<div class="menu-sep"></div> <!-- 分割线-->
					<div>菜单三</div>
				</div>
		</div> 
		
		<div data-options="region:'south',title:'South Title',split:true" style="height:100px;">南部地区</div> 
		
		<div data-options="region:'east',iconCls:'icon-reload',title:'East',split:true" style="width:100px;">东部地区</div> 
		
		<div data-options="region:'west',title:'菜单导航',split:true" style="width:180px;">
			<!--
            	控制面板
            -->
			<div id="aa" class="easyui-accordion"  style="width:300px;height:200px;"> 

				<div data-options="title:'基础菜单',fit:true">
					<!--
                    	制作蔬菜单
                    -->
					<ul id="baseMenu" class="ztree"></ul>
				</div>
				
				<div data-options="title:'系统菜单',fit:true">面板二</div>
				
			</div>

		</div> 
		
		<div data-options="region:'center',title:'消息中心'" data-options="fit:true" style="padding:5px;background:#eee;">
			<!-- 选项卡面板-->
			<div id="mytabs" class="easyui-tabs"  style="width:500px;height:250px;"> 
					<div title="Tab1"  data-options="title:'选项卡面板一',closable:true">选项卡面板一 </div> 
					
					<div title="Tab2" data-options="title:'选项卡面板二',closable:true">选项卡面板二 </div> 
					
				
		</div> 
		
		<!--
        	系统主页菜单选项强化
        -->
		<div id="mm" class="easyui-menu" style="width:120px;"> 
			
			<div>关闭当前选项</div>
			<div>关闭其他选项</div>
			<div class="menu-sep"></div> <!-- 分割线-->
			<div data-options="iconCls:'icon-cancel'">关闭所有选项</div>
		</div>
	</body> 

 


</html>
